package com.subway.babynote;
/*水*/
import com.subway.babynote.syncservice.syncapi;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class feedbackfinish extends Activity {
	private static final int INVISIBLE = 0x00000004;
	TextView feedback_view;
	Button login_button;
	Button statistics_button;
	NotedbHelper notedb;
	private LinearLayout linearLayout, statistics, sync, more;
	Intent In;
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.feedbackfinish);
		setTitle(R.string.feedbacktitle);
		In = new Intent();
		//initTabFunction();
		statistics_button = (Button) findViewById(R.id.statistics_button);
		login_button = (Button)findViewById(R.id.login_button);
		Bundle bundle = this.getIntent().getExtras();
		feedback_view = (TextView) findViewById(R.id.feedback_view);
		feedback_view.setText(bundle.getString("feedback"));
		notedb = new NotedbHelper(this);
		try {
			if (syncapi.getSyncImpl().getUserid() != -1) {
				login_button.setVisibility(INVISIBLE);
				login_button.setClickable(false);
			}
		} catch (Exception e) {
			Log.v("statistics", "from DB e=" + e.getMessage());
		}
		statistics_button.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {

				Intent In = new Intent();
				In.setClass(feedbackfinish.this, perdaystatistics.class);
				startActivity(In);
			}
		});
		login_button.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
			
				In.setClass(feedbackfinish.this, login.class);
				startActivity(In);
			}
		});
	}
	

	
	public void onDestroy(){
		   notedb.close();
		   super.onDestroy();	  	   
		   
		}
	
}